package hu.szyrt.bug.models;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Comment {

	//2012-08-10 02:22:09
	private final static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	private final static SimpleDateFormat dateReFormat = new SimpleDateFormat("dd/MM/yyyy");
	
	private String name,
				   comment,
				   dateString;
	
	private Date date;
	private String reformattedDate;
	
	
	public Comment(String name, String date, String comment) {
		this.name = name;		
		this.comment = comment;
		this.dateString = date;
		try {
			this.date = dateFormat.parse(date);
			this.reformattedDate = dateReFormat.format(this.date);
		} catch (ParseException e) {
			
			e.printStackTrace();
		}
	}

	public String getName() {
		return name;
	}
	
	public String getDateString() {
		return dateString;
	}

	public String getComment() {
		return comment;
	}
	
	
	public Date getDate() {
		return date;
	}
	
	public String getReformattedDate() {
		return reformattedDate;
	}
	
	
}
